#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/9/17 9:53
# @Author: 张涛
# @Email: xxx@gmail.com
# @File：chanpin_rc_page.py



"""
日程界面
"""

from selenium.webdriver.common.by import By
from pages.base_page import BasePage


class Schedule(BasePage):
    rctj_locator = (By.XPATH,'/html/body/div[5]/div/div[2]/div[5]/div/div[2]/a') #日程添加
    rczt_locator = (By.XPATH,'/html/body/div[12]/div[2]/form/table/tbody[2]/tr[2]/td[2]/input') #日程主题
    rcms_locator = (By.XPATH,'/html/body/div[12]/div[2]/form/table/tbody[2]/tr[5]/td[2]/textarea') #日程描述
    rcbc_locator = (By.XPATH,'/html/body/div[12]/div[2]/form/table/tfoot/tr/td[2]/input[1]') #保存日程
    rctsnr_locator = (By.XPATH,'/html/body/div[5]/div/div[2]/div[1]/div[2]/div') #日程提示内容

    def rctj_element(self):
        '''点击添加日程'''
        self.driver.find_element(*self.rctj_locator).click()

    def rczt_element(self,rczt_a):
        '''输入日程主题'''
        self.driver.find_element(*self.rczt_locator).send_keys(rczt_a)

    def rcms_element(self,rcms_a):
        '''输入日程描述'''
        self.driver.find_element(*self.rcms_locator).send_keys(rcms_a)

    def rcbc_element(self):
        '''点击日程保存'''
        self.driver.find_element(*self.rcbc_locator).click()

    def rctsnr_element(self):
        '''获取日程提示内容'''
        rctsnr = self.driver.find_element(*self.rctsnr_locator).text
        return rctsnr